<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

/**
 * @api {get} /user/init 初始化一个高权限root用户
 * @apiName 用户初始化
 * @apiGroup User
 *
 * @apiSuccessExample {json} 成功的请求:
 * {
 *   code:0, //成功返回code0,
 *   message: 'xxxx',  //信息提示
 * }
 * @apiErrorExample {json} 失败的请求：
 * {
 *   code:1, //失败返回code1,
 *   message: 'xxxx',   //信息提示
 * }
 */

$router->get('doc', 'DocController@index');

$router->get('user/init', 'UserController@init');
$router->post('user/register', 'UserController@register');
$router->post('user/login', 'UserController@login');
$router->get('user/logout', 'UserController@logout');
$router->get('user/info', 'UserController@info');
$router->post('user/resetPassword', 'UserController@resetPassword');
$router->get('user/list', 'UserController@list');
$router->get('user/get', 'UserController@get');
$router->post('user/modify', 'UserController@modify');
$router->post('user/delete', 'UserController@delete');

$router->post('ordersource/add', 'OrderSourceController@add');
$router->post('ordersource/modify', 'OrderSourceController@modify');
$router->get('ordersource/list', 'OrderSourceController@list');
$router->get('ordersource/info', 'OrderSourceController@info');
$router->post('ordersource/delete', 'OrderSourceController@delete');

$router->post('product/add', 'ProductController@add');
$router->post('product/modify', 'ProductController@modify');
$router->get('product/list', 'ProductController@list');
$router->get('product/info', 'ProductController@info');
$router->post('product/delete', 'ProductController@delete');

$router->post('product/add-order-source', 'ProductController@addOrderSource');
$router->post('product/modify-order-source', 'ProductController@modifyOrderSource');
$router->get('product/order-source-list', 'ProductController@orderSourceList');

$router->post('excel/load', 'ExcelController@load');
$router->post('excel/export', 'ExcelController@export');
$router->get('excel/test', 'ExcelController@test');
